package com.zhai.test.domain.rebate;

import com.zhai.domain.rebate.model.entity.BehaviorEntity;
import com.zhai.domain.rebate.model.valobj.BehaviorTypeVO;
import com.zhai.domain.rebate.service.IBehaviorRebateService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.RandomStringUtils;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import javax.annotation.Resource;
import java.util.List;
import java.util.concurrent.CountDownLatch;

/**
 * @Description: 返利服务测试类
 * @ClassName: RebateServiceTest
 * @Author: zhaiyongxin
 * @Date: 2025/5/27 16:03
 * @Version: 1.0
 */
@SpringBootTest
@Slf4j
@RunWith(SpringRunner.class)
public class RebateServiceTest {

    @Resource
    IBehaviorRebateService rebateService;

    @Test
    public void test_createOrder() throws InterruptedException {
        BehaviorEntity behaviorEntity = new BehaviorEntity();
        behaviorEntity.setUserId("zhaiyongxin");
        behaviorEntity.setBehaviorTypeVO(BehaviorTypeVO.SIGN);
        behaviorEntity.setOutBusinessNo("20250603");
        List<String> order = rebateService.createOrder(behaviorEntity);
        log.info("增加日常返利行为订单 order size:{} order {}", order.size(), order);
        new CountDownLatch(1).await();
    }
}
